package com.ruoyi.SuveryInterface.Imp.mapper;


import com.ruoyi.SuveryInterface.Imp.domain.SysCredit;
import com.ruoyi.SuveryInterface.Imp.domain.SysCreditEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-02
 */
public interface SysCreditMapper {

    @Insert("insert into sys_credit (code,out_trade_no,tran_amt,tran_time,sign,result,result_msg,data_tag,data_result,data_message,data_badPlatformNum,data_goodPlatformNum,data_maxMoney,data_lastTime,data_maxDay,order_id,create_time)" +
            "values (#{code},#{outTradeNo},#{tranAmt},#{tranTime},#{sign},#{result},#{resultMsg},#{dataTag},#{dataResult},#{dataMessage},#{dataBadPlatformNum},#{dataGoodPlatformNum},#{dataMaxMoney},#{dataLastTime},#{dataMaxDay},#{orderId},#{createTime})")
    void insert(SysCreditEntity sysCredit);


    @Select("select * from sys_credit where order_id = #{orderId} order by create_time desc")
    List<SysCredit> selectSysCreditByOrderId(Long orderId);


    @Insert("insert into sys_credit (code,out_trade_no,tran_amt,tran_time,sign,result,result_msg,data_tag,data_result,data_message,data_badPlatformNum,data_goodPlatformNum,data_maxMoney,data_lastTime,data_maxDay,order_id,create_time)" +
            "values (#{code},#{out_trade_no},#{tran_amt},#{tran_time},#{sign},#{result},#{result_msg},#{data_tag},#{data_result},#{data_message},#{data_badPlatformNum},#{data_goodPlatformNum},#{data_maxMoney},#{data_lastTime},#{data_maxDay},#{order_id},#{create_time})")
    void insertSysCredit(SysCredit sysCredit);
}
